package common

import "time"

type ExecStatus string

const (
	ExecStatusWaitExec  ExecStatus = "WAIT_EXEC"
	ExecStatusExecuting ExecStatus = "EXECUTING"
	ExecStatusSuccess   ExecStatus = "SUCCESS"
	ExecStatusFail      ExecStatus = "FAIL"
)

type BaseQuery struct {
	Device         string        `json:"device" binding:"required"`
	Port           int16         `json:"port"`
	User           string        `json:"user"`
	Password       string        `json:"password"`
	AsyncTimeoutMs time.Duration `json:"asyncTimeoutMs"` // nil，等待默认时间后异步; 小于或等于0，异步；大于0，同步转异步
	Channel        uint          `json:"channel" binding:"required"`
	Priority       int           `json:"priority"`                  // 值越小优先级越高
	ReadOnly       bool          `json:"readOnly"`                  // true: 只读操作；false：读写操作
	Caller         string        `json:"caller" binding:"required"` // 调用者
}
